<?php

Framework::needsToImplement("ICodeInterface");
Framework::needsToImplement("IWCDefaults");

class FormLayout implements IWCDefaults, ICodeInterface {
	
	private $columns;
	private $icode;
	private $method;
	private $statusbar;
	private $description;
	
	public function __construct() {
		$this->icode=Array(
			'add'=>'addElement',
			'columns'=>'setColumns',
			'percolumn'=>'setPerColumn',
		);		

	}
	public function icodeSet($prop,$value){
		if(isset($this->icode[$prop])) {
				$op=$this->icode[$prop];
				$this->$op($value);			
		}
	}
	
	/**
	 * @return unknown
	 */
	public function getColumns() {
		return $this->columns;
	}
	
	/**
	 * @param unknown_type $columns
	 */
	public function setColumns($columns) {
		$this->columns = $columns;
	}

	private $percolumn=1;
	
	private $elements;
	
	/**
	 * @return unknown
	 */
	public function getElements() {
		return $this->elements;
	}
	
	/**
	 * @return unknown
	 */
	public function getPerColumn() {
		return $this->percolumn;
	}
	
	/**
	 * @param unknown_type $elements
	 */
	public function addElement($element) {
		$this->elements[] = $element;
	}
	
	/**
	 * @param unknown_type $percolumn
	 */
	public function setPerColumn($percolumn) {
		$this->percolumn = $percolumn;
	}
	public function __toString() {
		return "percolumn: ".$this->percolumn.',elements: '.count($this->elements);
	}
	public function icodeSupportedProperties() {
		return $this->icode;	
	}
}

?>
